--------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  X:\shared\ambulance\Work\replicationpackage\logs\denial_analysis.log
  log type:  text
 opened on:  13 Jul 2024, 07:42:55

. 
. /*******************************************************************************
> denial_analysis.do
> 
> This code cleans and analyzes the ride-level panel with denials
> *******************************************************************************/
. 
. clear all

. 
. qui {

. 
. preserve

. collapse (mean) denied, by(priorauth_date date year)

. sort date

. label values date dates

. twoway (line denied date if priorauth_date==1) ///
>         (line denied date if priorauth_date==2, lpattern(longdash_dot)) ///
>         (line denied date if priorauth_date==0, lpattern(shortdash)) ///
>         (pcarrowi .225 19950 .225 20050, color(black) ) ///
>         (pcarrowi .225 20570 .225 20470, color(black) ), ///
>         xline(20058 20454) text( .225 19950 "1st Reg.", place(w) size(small)) ///
>         text( .225 20570 "2nd Reg.", place(e) size(small)) ///
>         xti(" ") yti("Share Denied") ///
>         xlab(18993 19724 20454 21185, val) ///
>         ylab(, format(%9.0gc)) ///
>         xline(20058 20454) ///
>         graphregion(color(white)) bgcolor(white) ///
>         leg(subti("Patient State of Residence") ///
>                 order(1 "NJ, SC, PA" 2 "DE, DC, MD, NC, VA, WV" 3 "No Prior Auth."))

. qui graph export "${outpath}Figure_10.pdf", as(pdf) replace // Figure 10

. restore

. 
. su denied if date>=dofm(ym(2013,11)) & date<dofm(ym(2014,11)) & priorauth_date==1 // Referenced in Section 6.4, Paragraph 1 and Appendix Section J.2, 
> Bullet 5

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      denied |    988,920    .0572645    .2323474          0          1

. tab date if date>=dofm(ym(2014,11)) & date<=dofm(ym(2015,2)) & priorauth_date==1, su(denied) me // Referenced in Section 6.4, Paragraph 1 and Appendix
>  Section J.2, Bullet 5

            | Summary of
            |   denied
       date |        Mean
------------+------------
     3629m1 |   .08859193
     3631m7 |   .17249871
       2015 |   .22676161
     3636m9 |   .16633866
------------+------------
      Total |   .14577749

. 
. qui {

. 
. coefplot, keep(*months_since*) vert baselevel ///
>         recast(connected) ciopt(recast(rcap)) ///
>         xti(Months Since Prior Authorization Implementation) ///
>         xlab(1 "-24" 7 "-18" 13 "-12" 19 "-6" 25 "0" ///
>                 31 "6" 37 "12" 43 "18" 49 "24") ///
>         xline(25, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8)) ///
>         yti("Firm-Level Claim Denial Rate") ///
>         ylab(, angle(0)) ///
>         graphregion(color(white)) bgcolor(white)

.         
. qui {

. 
. coefplot, keep(*months_since*) vert baselevel ///
>         recast(connected) ciopt(recast(rcap)) ///
>         xti(Months Since Prior Authorization Implementation) ///
>         xlab(1 "-24" 7 "-18" 13 "-12" 19 "-6" 25 "0" ///
>                 31 "6" 37 "12" 43 "18" 49 "24") ///
>         xline(25, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8)) ///
>         yti("Firm-Level Claim Denial Rate") ///
>         ylab(, angle(0)) ///
>         graphregion(color(white)) bgcolor(white)

.         
. qui {

. 
. sort plotmo

. twoway (connected group0_b plotmo, lcolor(ebblue) msym(|)) ///
>         (line group0_ll plotmo if plotmo<-1, lcolor(ebblue%30)) ///
>         (line group0_ul plotmo if plotmo<-1, lcolor(ebblue%30)) ///
>         (line group0_ll plotmo if plotmo>-1, lcolor(ebblue%30)) ///
>         (line group0_ul plotmo if plotmo>-1, lcolor(ebblue%30)) ///
>         (connected group1_b plotmo, lcolor(erose) msym(|)) ///
>         (line group1_ll plotmo if plotmo<-1, lcolor(erose%30)) ///
>         (line group1_ul plotmo if plotmo<-1, lcolor(erose%30)) ///
>         (line group1_ll plotmo if plotmo>-1, lcolor(erose%30)) ///
>         (line group1_ul plotmo if plotmo>-1, lcolor(erose%30)) ///
>         (connected group2_b plotmo, lcolor(ebg) msym(|)) ///
>         (line group2_ll plotmo if plotmo<-1, lcolor(ebg%30)) ///
>         (line group2_ul plotmo if plotmo<-1, lcolor(ebg%30)) ///
>         (line group2_ll plotmo if plotmo>-1, lcolor(ebg%30)) ///
>         (line group2_ul plotmo if plotmo>-1, lcolor(ebg%30)), ///
>         xti(Months Since Prior Authorization Implementation) ///
>         xlab(1 "-24" 7 "-18" 13 "-12" 19 "-6" 25 "0" ///
>                 31 "6" 37 "12" 43 "18" 49 "24") ///
>         xline(25, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8)) ///
>         yti("Firm-Level Claim Denial Rate") ///
>         ylab(, angle(0)) leg(off) ///
>         graphregion(color(white)) bgcolor(white)

. qui graph export ${outpath}Figure_A12c.pdf, as(pdf) replace // Figure A12c

. 
. tab exit_at_PA if date>=dofm(ym(2013,11)) & date<dofm(ym(2014,11)) & priorauth_date==1, su(denial_rate) // Referenced in Section 6.4, Paragraph 1 and 
> Appendix Section J.2, Bullet 5

            |       Summary of denial_rate
 exit_at_PA |        Mean   Std. dev.       Freq.
------------+------------------------------------
          0 |   .06878632   .19146493       4,286
          1 |   .08143453    .2033038         900
------------+------------------------------------
      Total |   .07098135   .19361051       5,186

. tab date exit_at_PA if date>=dofm(ym(2014,11)) & date<=dofm(ym(2015,2)) & priorauth_date==1, su(denial_rate) me // Referenced in Section 6.4, Paragrap
> h 1 and Appendix Section J.2, Bullet 5

                           Means of denial_rate

           |     exit_at_PA
      date |         0          1 |     Total
-----------+----------------------+----------
    3629m1 | .07441229  .11748863 | .08465348
    3631m7 | .15905938  .19340539 | .16766698
      2015 | .32883674  .52466667 | .34548895
    3636m9 | .27644145          . | .27644145
-----------+----------------------+----------
     Total | .20343777  .19750185 | .20247565

. 
. log close
      name:  <unnamed>
       log:  X:\shared\ambulance\Work\replicationpackage\logs\denial_analysis.log
  log type:  text
 closed on:  13 Jul 2024, 07:49:07
--------------------------------------------------------------------------------------------------------------------------------------------------------
